package com.xt.control;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
public class Httptest extends HttpServlet {
    @GetMapping("test")
    public String http(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException {
        System.out.println(req.getLocalAddr());
        System.out.println(req.getCookies());
        System.out.printf(String.valueOf(req.getLocalPort()));
        System.out.println(req.getRemoteAddr());



        return req.getLocalAddr();
    }
}
